package com.jbit.controller;

import com.github.pagehelper.PageInfo;
import com.jbit.pages.Page;
import com.jbit.service.DmItemService;
import com.jbit.utils.ResponseEntity;
import com.jbit.vo.DmItemVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/search/api/p/list")
public class SearchController {
    @Resource
    private DmItemService dmItemService;

    @PostMapping("/queryItemList")
    public ResponseEntity queryItemList(@RequestBody DmItemVo dmItemVo) {
        PageInfo pageInfo = dmItemService.queryItemList(dmItemVo);
        return ResponseEntity.sendSuccess(Page.getPage(pageInfo));
    }
}
